/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.coupon.service;

import java.util.List;

import com.wealth.coupon.entity.CouponRecord;

import iaas.service.IBaseService;
import iaas.utils.ResultObject;

/**
 * @author chan
 */
public interface ICouponRecordService extends IBaseService<CouponRecord>{
	
	/**
	 * 验证优惠券是否有效，针对“纸质优惠券”
	 */
	public ResultObject isValid(Long memberid,String code) throws Exception;
	
	/**
	 * 添加优惠券，针对“纸质优惠券” 已经生成优惠券码
	 * @param memberid 会员ID
	 * @param code 优惠券码
	 * @return
	 * @throws Exception
	 */
	  
	public ResultObject saveCoupon(Long memberid,String code) throws Exception;
	
	/**
	 * 会员线上领取优惠券
	 * @param memberid 会员ID
	 * @param corpid 企业id
	 * @return
	 * @throws Exception
	 */
	public ResultObject receiveCoupon(Long memberid,Long corpid) throws Exception;
	/**
	 * 使用优惠券
	 */
	public ResultObject useCoupon(Long orderid,Long couponRecordId) throws Exception;
	
	/**
	 * 生成优惠券，针对“系统发放优惠券”by chan on 2016-09-26
	 */
	public ResultObject generateCoupon(Long memberid,Long corpid,Integer couponMode) throws Exception;
	
	
	
	/**
	 * 查询优惠券 状态
	 */
	public List<CouponRecord> getCouponRecordByMemberIdAndStatus(Long memberid,Integer status)throws Exception;
	
	/**
	 * 会员的可用优惠券
	 */
	public List<CouponRecord> getUsableCouponRecord(Long memberid,Double total)throws Exception;
	
	
	
}
